<!--suppress ALL -->
<include file="./Template/header.html" />

<link rel="stylesheet" type="text/css" href="/Template/css/finishedProductList.css?v=2020080304">
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">

	$(function() {

		//初始化页面配置
		document.title = "团购产品列表";

		var app = new Vue({
			el: '#container',
			data: {
				productList: [],
			},
			methods: {
                orderList: function() {
                    if("{$status}" == -1){
                        window.location.href = "/wechat/userCenter/myOrder?status=-2";
					}else{
                        window.location.href = "/wechat/userCenter/myOrder?status=0";
					}
                },
                help: function() {
                    window.location.href = "/wechat/clubfoot/faqDetail/id/41";
                },
				order: function(id) {
					window.location.href = "/wechat/order/groupOrder/?id="+id + "&status={$status}";
				}
			}
		})

		function getProductList() {

			$.ajax({
				url:"/wechat/product/groupProductList",
				type:"post",
				data:{
//					categoryId: categoryId
					status:"{$status}",
				},
				dataType:"JSON",
				beforeSend:function(){
					$("#loadingToast").show();
				},
				complete:function(){
					$('#loadingToast').hide();
				},
				success:function(data){
//				    alert(data.length());
					app.productList = data;
                    if(isNullOrEmpty(data)){
                        window.location.href = "/wechat/userCenter/myOrder?status=0";
                    }
                    setTimeout(function() {
                        $(".ui-item.measure-info img").bind("click", function() {
                            var upUrl = "/Template/images/icon-up.png";
                            var downUrl = "/Template/images/icon-down.png";
                            $(this).parent().next().toggle();
                            if($(this).attr("src") == upUrl) {
                                $(this).attr("src", downUrl);
                            } else {
                                $(this).attr("src", upUrl);
                            }
                        });
                        $(".ui-item.measure-info img").each(function() {
                            $(this).trigger("click");
                        });
                    },200);
				},
			})
		}
        $(".search-box").change(function() {
            var value = $(this).find("option:selected").text();
            $(this).prev().attr('placeholder',value);
        });

		getProductList();
	});


</script>

<div class="container">
	<div class="no-data" v-if="productList == null")>暂无团购</div>
	<!--<div class="qiandao-bottom">-->
		<!--<div class="qiandao-rule-list">-->
			<!--&lt;!&ndash;<h4>团购介绍：</h4>&ndash;&gt;-->
			<!--<p>本次团购为小胖威利综合征的宝宝开放，目的是预防脊柱侧弯的发生和进展，适用于胸围70厘米以下学龄前儿童。如果您的宝宝：</p>-->
			<!--<p style="margin-top:7px"><a style="font-weight: bold">· </a><a style="color:#5f94ed; font-weight: bold">没有发生脊柱侧弯或侧弯角度在20度以下</a>,请选择<a style="color:#5f94ed; font-weight: bold">VX系列</a></p>-->
			<!--<p><a style="font-weight: bold">· </a><a style="color:#5f94ed; font-weight: bold">侧弯角度在20度以上</a>,请选择<a style="color:#5f94ed; font-weight: bold">VT系列</a></p>-->
			<!--<p style="margin-top:7px">该产品需贴身穿戴，所以<a style="font-weight: bold">售出后不能退换</a>。</p>-->
			<!--&lt;!&ndash;p>本次团购为小胖威利综合征的宝宝开放，目的是预防脊柱侧弯的发生和进展。-->
				<!--如果宝宝<a style="color:#5f94ed; font-weight: bold">没有发生脊柱侧弯或侧弯角度在20度以下</a>，请选择<a style="color:#5f94ed; font-weight: bold">VX系列</a>；-->
				<!--如果宝宝<a style="color:#5f94ed; font-weight: bold">侧弯角度在20度以上</a>，请选择<a style="color:#5f94ed; font-weight: bold">VT系列</a>。-->
				<!--该产品需贴身穿戴，所以<a style="font-weight: bold">售出后不能退换</a>。-->
			<!--</p&ndash;&gt;-->
		<!--</div>-->
	<!--</div>-->
	<div class="finishedProduct-info" v-for="list in productList">
		<div class="have-padding">
			<div class="product-info">
				<img class="finishedProduct-img" src="{{list.image_url}}" alt="product">
				<div class="detail-info">
					<p class="product-name">{{list.product_name}}
						<button v-on:click="order(list.product_id)">团 购</button>
					</p>
					<p class="product-price"><span style="color: #d92f3b;"><a style="color: #e99c47">团购价：</a>￥{{list.group_price}}</span> / {{list.unit}}</p>

					<!--<p class="product-class">{{list.class_name}}</p>-->
					<!--p class="product-supplier">[{{list.supplier_name}}]</p-->
					<!--p class="product-supplier" style="width: 8rem">已售：{{list.count}} {{list.unit}}</p-->
					<p class="product-size">规格：{{list.size}} </p>
				</div>
				<!--p class="sum">共{{order.number}}件商品 合计:<span style="color: #d92f3b;">￥{{order.price}}</span></p-->
			</div>
			<div class="finishedProduct-detail-info">
				<div class="ui-item measure-info">
					<span class="item-class">期限：{{list.expiry_date}}</span>
					<span class="item-detailname">详细信息</span>
					<img class="icon-up" src="/Template/images/icon-up.png" alt="">
				</div>
				<div>
					<div class="ui-item ">
						<!--<span class="item-left">说明</span>-->
						<span class="item-all">{{list.function}}</span>
					</div>
				</div>
			</div>
		</div>
		<div class="line"></div>
	</div>
	<br/><br/>
	<div class="order-operation" style="height: 4rem">
		<ul style="position: relative; line-height: 4rem">
			<li class="recomend" v-on:click="orderList()">
				<img src="/Template/images/icon-orderList.png" alt="">
				<span>团购记录</span>
			</li>
			<li class="activity" v-on:click="help()">
				<img src="/Template/images/icon-help.png" alt="">
				<span>相关帮助</span>
			</li>
		</ul>
	</div>
	<!--if condition="$customer['subscribe'] neq 1">
		<div class="subscribe">
			<div class="pop-frame">
				<div class="hint">
					<div class="line"></div>
					<p class="rec-title">无法识别二维码?</p>
					<ul>
						<li>1、打开微信,点击添加朋友</li>
						<li>2、搜索微信号:xwkkffj</li>
						<li>3、点击”关注”,完成</li>
					</ul>
				</div>
			</div>
			<div class="two-d-code">
				<img class="two-d-code-bg" src="/Template/images/doc-2d-code-bg.png" alt="">
				<img class="two-d-code-img" src="/Template/images/xwk-qrcode.jpg" alt="">
				<p class="recognize">
					长按图片[识别二维码]关注公众号
				</p>
			</div>
		</div>
	</if-->
</div>
<include file="./Template/footer.html" />

